

#ifndef AUDIO_RENDERER_H
#define AUDIO_RENDERER_H

#include <ohaudio/native_audiorenderer.h>
#include <ohaudio/native_audiostreambuilder.h>
#include <ohaudio/native_audiostream_base.h>

#include "sample_info.h"

class AudioRenderer {
public:
    AudioRenderer() = default;
    ~AudioRenderer();

    void AudioRendererInit(SampleInfo& sampleInfo, CodecUserData *audioDecContext);
    void AudioRendererStart();
    void AudioRendererRelease();
    OH_AudioStream_Result GetTimestamp(clockid_t clockId, int64_t* framePosition, int64_t* timestamp);
    
private:
    OH_AudioRenderer *audioRenderer_ = nullptr;
    OH_AudioStreamBuilder *builder_ = nullptr;
};

#endif  // AUDIO_RENDERER_H